import request from '@/utils/request';

const resourceApi = {};

/* 为角色设置用户 */
resourceApi.allocateRoles = (id, params) => {
	return request({
		url: '/auth-api/resource/allocate-roles/' + id,
		method: 'put',
		data: params
	})
}
resourceApi.list = () => {
	return request({
		url: '/auth-api/resource/list',
		method: 'get',
	})
}
resourceApi.page = (params) => {
	return request({
		url: '/auth-api/resource/page',
		method: 'get',
		params: params,
	})
}
resourceApi.get = (id) => {
	return request({
		url: '/auth-api/resource/' + id,
		method: 'get',
	})
}
resourceApi.delete = (id) => {
	return request({
		url: '/auth-api/resource/' + id,
		method: 'delete',
	})
}
resourceApi.add = (params) => {
	return request({
		url: '/auth-api/resource',
		method: 'post',
		data: params
	})
}
resourceApi.update = (params) => {
	return request({
		url: '/auth-api/resource',
		method: 'put',
		data: params
	})
}
export default resourceApi